
const { log } = require('./common')
const keyPrefx = 'youxuan-'
function setStore(key, payload) {
  try {
    wx.setStorageSync(keyPrefx + key, payload)
  } catch (e) {
    log('Set store error ' + key)
  }
}

function getStore(key) {
  try {
    return wx.getStorageSync(keyPrefx + key)
  } catch (e) {
    log('Get store error ' + key)
  }
}

function removeStore(key) {
  try {
    wx.removeStorageSync(keyPrefx + key)
  } catch (e) {
    log('Get store error ' + key)
  }
}

function clearStore() {
  try {
    wx.clearStorageSync()
  } catch (e) {
    log('Clear store error ')
  }
}
module.exports = {
  setStore,
  getStore,
  removeStore,
  clearStore
}